package com.magic.gre.ui.activity;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.TextView;

import com.magic.gre.R;
import com.magic.gre.base.activity.BaseCenterActivity;
import com.magic.gre.helper.Apphelper;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * Author: Lmoumou
 * Date: 2019-01-10 20:36
 * 文件名: LearnSetActivity
 * 描述:
 */
public class LearnSetActivity extends BaseCenterActivity {

    @BindView(R.id.mTextView)
    TextView mTextView;

    public static void startThis(Context context) {
        Intent intent = new Intent(context.getApplicationContext(), LearnSetActivity.class);
        context.startActivity(intent);
    }

    @Override
    protected int getLayoutId() {
        return R.layout.activity_learn_set;
    }

    @Override
    protected void initView(@Nullable Bundle savedInstanceState) {
        mTextView.setSelected(Apphelper.getVoice());
    }

    @OnClick(value = {R.id.mTextView})
    protected void onClick(View view) {
        switch (view.getId()) {
            case R.id.mTextView:
                mTextView.setSelected(!mTextView.isSelected());
                Apphelper.putVoice(mTextView.isSelected());
                break;
        }
    }

}
